﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DataLib.Accounts.Bus;

namespace Ewts.Storage
{
    public partial class OutStorageList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                User curUser = new User();
                curUser = (User)Session["UserInfo"];
                 ListItem item = new ListItem();
                item.Text = "--请选择--";
                item.Value = "";
                DataLib.BLL.City bllLib = new DataLib.BLL.City();
 
                // 处理地
                dropGraphic.DataSource = bllLib.GetList(" flag1 ='02'");
                dropGraphic.DataTextField = "cityname";
                dropGraphic.DataValueField = "cityname";
                dropGraphic.DataBind();
                dropGraphic.Items.Insert(0, item);

                if (curUser.UserType != "AD")
                {
                    dropGraphic.Enabled = false;
                    dropGraphic.SelectedValue = curUser.CompanyCity;
                //    bindData(dropGraphic.SelectedValue);
                }
                else
                {
                 //   bindData("");
                }
            }
        }

        //protected void bindData(string city)
        //{
        //    DataTable dt = new DataLib.BLL.OutStorage().GetList(" outDepart like '%" + city + "%' order by id desc").Tables[0];
        //    rept.DataSource = dt;
        //    rept.DataBind();
        //}



        protected string GetUpdateOper(string id,string status)
        {

            string str = "<a href='/Storage/outStorageUpdate.aspx?outid=" + id + "'>出库维护</a>";
            //if (status == "0")
            //    str = "<a style='color:#aaa'>出库维护</a>";
                return str;
        }

        //protected void dropGraphic_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    bindData(dropGraphic.SelectedValue);
        //}
    }
}